
  <ul>
    <li class="code">站点编号</li>
    <li class="name">运行名称</li>
    <li class="oldname">曾用名称</li>
  </ul>
<?php 
  	$q = $_GET['query'];
	$sql = "SELECT StID,StCode,StName,StOldName FROM stations WHERE";
	$sql .=" stname like '%".$q."%'";
	$sql .=" OR stoldname like '%".$q."%'";
	$sql .=" OR stcode like '%".$q."%'";
	$sql .=" order by StID";
	
	//echo $sql;
	$conn = mysql_pconnect("localhost:3306","addan","addan12");
	mysql_select_db("pdata");
	$rs = mysql_query($sql,$conn) or die(mysql_error());
	while($row = mysql_fetch_array($rs))
	{
		echo "<ul>";
		echo "<li class='code'> ".$row['StCode']."</li>";
		echo "<li class='name'><a href='/stations/st_edit.php?stid=".$row['StID']."'> ".$row['StName']."</a></li>";
		echo "<li class='oldname'> ".$row['StOldName']."</li>";

		echo "</ul>";
	}
	mysql_close($conn);

?>


